﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Text;
using System.Xml;

/// <summary>
///ZXTJLX_Obj_Manager 的摘要说明
/// </summary>
public class ZXTJLX_Obj_Manager
{
    public ArrayList ZXTJLX_Objs;
    public ZXTJLX_Obj_Manager(string xmlPath)
    {
        ZXTJLX_Objs = new ArrayList();
       
        ZXTJLX_Obj ob = null;
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(ExSystem.ExIO.ExFile.ReadToEnd(xmlPath));
        XmlNodeList pageList = xmlDoc.SelectNodes("root/page");
        XmlAttribute array1, array2;
        foreach (XmlNode node in pageList)
        {
            ob = new ZXTJLX_Obj();
            ob.MC = node.Attributes["name"].Value;
            ob.ProcedureName = node.Attributes["ProcedureName"].Value;
            ob.ProcedureName_FC = node.Attributes["ProcedureName_FC"].Value;
            ob.Html_Title = node.Attributes["Html_Title"].Value;
            ob.Html_Table_Thead = node.InnerText;
            array1 = node.Attributes["money_column"];
            array2 = node.Attributes["people_column"];
            if (array1 != null) ob.money_columns = array1.Value.Split(',');
            if (array2 != null) ob.people_columns = array2.Value.Split(',');
            
            ZXTJLX_Objs.Add(ob);
        }     
    }
    public ZXTJLX_Obj getZXTJLX_Obj(string mc)
    {
        foreach (ZXTJLX_Obj ob in ZXTJLX_Objs)
        {
            if (ob.MC.Trim().ToLower() == mc.Trim().ToLower()) return ob;
        }
        return null;
    }
}
